package cn.kgc.spring.entity;

/**
 * @author: mosin
 * @version: v1.0  2022/10/11
 */
public class User {

    private Integer id;
    private String name;

    public User(Integer id, String name) {
        System.out.println("有参构造被调用");
        this.id = id;
        this.name = name;
    }

    public User() {
        System.out.println("无参构造被调用");
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        System.out.println("id的set方法被调用");
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        System.out.println("name的set方法被调用");
        this.name = name;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
